// components/new-user-alert/index.js
let url_js = require("../../utils/url.js");

Component({
  /**
   * 组件的属性列表
   */
  properties: {
    info: {
      type: Object,
      value: null
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    bgImgUr: url_js.imgUrl + "xrzx_bg.png",
    couponGg1ImgUr: url_js.imgUrl + "index_xr-bg1.png",
    couponGg2ImgUr: url_js.imgUrl + "index_xr-bg3.png",
  },

  /**
   * 组件的方法列表
   */
  methods: {
    // 点击商品
    onGoodsItem(e) {
      let index = e.currentTarget.dataset.index;
      let goodsItem = this.data.info.productList[index];
      this.triggerEvent('clickgoods', {
        item: goodsItem
      }, null);
    },

    // 查看
    onCheck(e) {
      this.triggerEvent('check', null, null);
    },

    // 关闭
    onClose(e) {
      this.triggerEvent('close', null, null);
    },
  }
})